home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / www / library / implemen / htacl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  3.5 KB  |  109 lines

  1. /*                                ACCESS CONTROL LIST ROUTINES
  2.                                              
  3.  */
  4.  
  5. #ifndef HTACL_H
  6. #define HTACL_H
  7.  
  8. #include "HTUtils.h"
  9. #include "HTAAUtil.h"
  10. #include "HTGroup.h"
  11.  
  12. #ifdef SHORT_NAMES
  13. #define HTAAgAFn        HTAA_getAclFilename
  14. #define HTAAoACL        HTAA_openAcl
  15. #define HTAAcACL        HTAA_closeAcl
  16. #define HTAAgAEn        HTAA_getAclEntry
  17. #endif /* SHORT_NAMES */
  18.  
  19. /*
  20.  
  21. Opening Access Control List File
  22.  
  23.  */
  24.  
  25. /* PUBLIC                                               HTAA_openAcl()
  26. **              OPEN THE ACL FILE FOR THE GIVEN DOCUMENT
  27. ** ON ENTRY:
  28. **      pathname        is the absolute pathname of
  29. **                      the file to be accessed.
  30. **
  31. ** ON EXIT:
  32. **      returns         the FILE* to open ACL.
  33. **                      NULL, if ACL not found.
  34. */
  35. PUBLIC FILE *HTAA_openAcl PARAMS((CONST char * pathname));
  36.  
  37.  
  38. /* PUBLIC                                               HTAA_closeAcl()
  39. **                      CLOSE ACL FILE
  40. ** ON ENTRY:
  41. **      acl_file is Access Control List file to close.
  42. **
  43. ** ON EXIT:
  44. **      returns nothing.
  45. */
  46. PUBLIC void HTAA_closeAcl PARAMS((FILE * acl_file));
  47. /*
  48.  
  49. Getting ACL Entry
  50.  
  51.  */
  52.  
  53. /* PUBLIC                                               HTAA_getAclEntry()
  54. **                      CONSULT THE ACCESS CONTROL LIST AND
  55. **                      GIVE A LIST OF GROUPS (AND USERS)
  56. **                      AUTHORIZED TO ACCESS A GIVEN FILE
  57. ** ON ENTRY:
  58. **      acl_file        is an open ACL file.
  59. **      pathname        is the absolute pathname of
  60. **                      the file to be accessed.
  61. **      method          is the method for which access is wanted.
  62. **
  63. ** ALC FILE FORMAT:
  64. **
  65. **      template : method, method, ... : group@addr, user, group, ...
  66. **
  67. **      The last item is in fact in exactly the same format as
  68. **      group definition in group file, i.e. everything that
  69. **      follows the 'groupname:' part,
  70. **      e.g.
  71. **              user, group, user@address, group@address,
  72. **              (user,group,...)@(address, address, ...)
  73. **
  74. ** ON EXIT:
  75. **      returns         NULL, if there is no entry for the file in the ACL,
  76. **                      or ACL doesn't exist.
  77. **                      If there is, a GroupDef object containing the
  78. **                      group and user names allowed to access the file
  79. **                      is returned (this is automatically freed
  80. **                      next time this function is called).
  81. ** IMPORTANT:
  82. **      Returns the first entry with matching template and
  83. **      method. This function should be called multiple times
  84. **      to process all the valid entries (until it returns NULL).
  85. **      This is because there can be multiple entries like:
  86. **
  87. **              *.html : get,put : ari,timbl,robert
  88. **              *.html : get     : jim,james,jonathan,jojo
  89. **
  90. ** NOTE:
  91. **      The returned group definition may well contain references
  92. **      to groups defined in group file. Therefore these references
  93. **      must be resolved according to that rule file by function
  94. **      HTAA_resolveGroupReferences() (group file is read in by
  95. **      HTAA_readGroupFile()) and after that access authorization
  96. **      can be checked with function HTAA_userAndInetGroup().
  97. */
  98. PUBLIC GroupDef *HTAA_getAclEntry PARAMS((FILE *        acl_file,
  99.                                           CONST char *  pathname,
  100.                                           HTAAMethod    method));
  101. /*
  102.  
  103.  */
  104.  
  105. #endif /* not HTACL_H */
  106. /*
  107.  
  108.    End of file HTACL.h.  */
  109.